<template>
	<view class="">
		<view class="topbox">
			<view class="imgbox">
				<image src="../../static/头像.jpg" mode=""></image>
			</view>
			<view class="name">
				蓓蓓
			</view>
			<view class="lastbox">
				<view class="smallbox">
					<view class="day">
						<text class="num">1</text>
						<text>天</text>
					</view>
					<view class="lxqd">
						连续签到
					</view>
				</view>
				<view class="qd" @click="handleqd">
					签到
				</view>
				<view class="smallbox">
					<view class="day">
						<text class="num">1</text>
						<text>天</text>
					</view>
					<view class="lxqd">
						总签到
					</view>
				</view>
			</view>
			<view class="qdjl" @click="record">
				签到记录
			</view>
		</view>
		<view class="calendarbox">
			<ss-calendar :checks="checks" @prev-month-day="onPrev" @next-month-day="onNext" />
		</view>
	</view>
</template>

<script>
	import ssCalendar from '@/components/ss-calendar/ss-calendar.vue'
	export default {
		data() {
			return {
				checks:[]
			}
		},
		methods: {
			// 签到记录
			record() {
				this.jumpLink({
					link: "/pagesB/record/index"
				})
			},
			// 签到功能
			onPrev(payload) {
				console.log('onPrev', payload)
			},
			onNext(payload) {
				console.log('onNext', payload)
			},
			handleqd() {
				let date = new Date();
				let year = date.getFullYear()
				let month = date.getMonth() + 1
				let day = date.getDate()
				this.checks.push(`${year}-${month}-${day}`)

			}
		}
	}
</script>

<style lang="scss" scoped>
	.topbox {
		width: 700rpx;
		height: 330rpx;
		background-image: url(../../static/image/组17_92.png);
		background-size: 700rpx 330rpx;
		background-blend-mode: normal,
			normal;
		border-radius: 10rpx;
		margin: 20rpx auto;
		padding-top: 49rpx;
		position: relative;

		.qdjl {
			position: absolute;
			top: 49rpx;
			right: 30rpx;
			width: 120rpx;
			height: 36rpx;
			border-radius: 18rpx;
			border: solid 1rpx #ffffff;
			font-family: MicrosoftYaHei;
			font-size: 22rpx;
			color: #fff;
			line-height: 36rpx;
			text-align: center;
		}

		.imgbox {
			width: 98rpx;
			height: 98rpx;
			border-radius: 98rpx;
			border: solid 2rpx #ffffff;
			margin: 0 auto;

			image {
				width: 94rpx;
				height: 94rpx;
				border-radius: 98rpx;
			}
		}

		.name {
			text-align: center;
			margin-top: 24rpx;
			color: #FFFFFF;
			font-weight: 700;
			font-family: MicrosoftYaHei-Bold;
			font-size: 30rpx;
		}

		.lastbox {
			display: flex;
			align-items: center;
			justify-content: space-around;
			margin-top: 30rpx;

			.smallbox {
				.day {
					text-align: center;

					text {
						font-family: MicrosoftYaHei;
						font-size: 24rpx;
						color: #fff;
					}

					.num {
						font-family: MicrosoftYaHei-Bold;
						font-size: 36rpx;
						font-weight: 700;
					}
				}

				.lxqd {
					text-align: center;
					font-family: MicrosoftYaHei;
					font-size: 24rpx;
					color: #fff;
				}
			}

			.qd {
				width: 180rpx;
				height: 56rpx;
				background-image: linear-gradient(0deg,
						#ff3b62 0%,
						#fd86a4 100%),
					linear-gradient(#ffffff,
						#ffffff);
				background-blend-mode: normal,
					normal;
				border-radius: 10rpx;
				line-height: 56rpx;
				text-align: center;
				font-family: MicrosoftYaHei;
				font-size: 30rpx;
				color: #fff;
			}
		}
	}
	.calendarbox{
		width: 700rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}
</style>
